The toString() method returns the string representation of any object. If you print any object, java compiler internally invokes the toString() method on the object. So overriding the toString() method, returns the desired output, it can be the state of an object etc. depends on your implementation.
Liked By
Write Answer
What is the purpose of toString() method in java ?
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
27-Apr-2015